<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // alert(a)
        // a();
        // var a = 3;

        // function a() {
        //     alert(10)
        // }
        // alert(a)
        // var a = 6
        // a()


        // var lili = {
        //     age: 1
        // };
        // (function() {
        //     var xiaoming = lili;
        //     xiaoming.age = 22;
        //     console.log(lili.age)
        //     console.log(xiaoming.age)
        // })()
        // console.log(lili.age)
        // console.log(xiaoming.age)

        const promise = new Promise((res, rej) => {
            res(1)
            rej(2)
            res(3)
        })
        promise.then(res => {
            console.log(res)
        }).catch(err => {
            console.log(err)
        })
    </script>
</body>

</html>